package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 测试具有方法下的接口权限
 */
@LagouController
@LagouRequestMapping("/homeworkTestMethod")
public class HomeWorkController2 {


    @LagouAutowired
    private IDemoService demoService;



    /**
     * 测试 zlz1 具有方法下的接口权限
     */
    @Security({"zlz1"})
    @LagouRequestMapping("/query1")
    public String query2(HttpServletRequest request, HttpServletResponse response,String name) {
        return demoService.get(name);
    }

    /**
     * 测试 zlz2 具有方法下的接口权限
     */
    @Security({"zlz2"})
    @LagouRequestMapping("/query2")
    public String query3(HttpServletRequest request, HttpServletResponse response,String name) {
        return demoService.get(name);
    }
}
